# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Run.V2.Model.GoogleCloudRunV2Condition do
  @moduledoc """
  Defines a status condition for a resource.

  ## Attributes

  *   `executionReason` (*type:* `String.t`, *default:* `nil`) - Output only. A reason for the execution condition.
  *   `lastTransitionTime` (*type:* `DateTime.t`, *default:* `nil`) - Last time the condition transitioned from one status to another.
  *   `message` (*type:* `String.t`, *default:* `nil`) - Human readable message indicating details about the current status.
  *   `reason` (*type:* `String.t`, *default:* `nil`) - Output only. A common (service-level) reason for this condition.
  *   `revisionReason` (*type:* `String.t`, *default:* `nil`) - Output only. A reason for the revision condition.
  *   `severity` (*type:* `String.t`, *default:* `nil`) - How to interpret failures of this condition, one of Error, Warning, Info
  *   `state` (*type:* `String.t`, *default:* `nil`) - State of the condition.
  *   `type` (*type:* `String.t`, *default:* `nil`) - type is used to communicate the status of the reconciliation process. See also: https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting Types common to all resources include: * "Ready": True when the Resource is ready.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :executionReason => String.t() | nil,
          :lastTransitionTime => DateTime.t() | nil,
          :message => String.t() | nil,
          :reason => String.t() | nil,
          :revisionReason => String.t() | nil,
          :severity => String.t() | nil,
          :state => String.t() | nil,
          :type => String.t() | nil
        }

  field(:executionReason)
  field(:lastTransitionTime, as: DateTime)
  field(:message)
  field(:reason)
  field(:revisionReason)
  field(:severity)
  field(:state)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.Run.V2.Model.GoogleCloudRunV2Condition do
  def decode(value, options) do
    GoogleApi.Run.V2.Model.GoogleCloudRunV2Condition.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Run.V2.Model.GoogleCloudRunV2Condition do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
